<?php

require_once(sfConfig::get('sf_lib_dir').'/filter/base/BaseFormFilterPropel.class.php');

/**
 * sfGuardUser filter form base class.
 *
 * @package    ##PROJECT_NAME##
 * @subpackage filter
 * @author     ##AUTHOR_NAME##
 * @version    SVN: $Id: sfPropelFormFilterGeneratedTemplate.php 16976 2009-04-04 12:47:44Z fabien $
 */
class BasesfGuardUserFormFilter extends BaseFormFilterPropel
{
  public function setup()
  {
    $this->setWidgets(array(
      'username'                      => new sfWidgetFormFilterInput(),
      'nickname'                      => new sfWidgetFormFilterInput(),
      'algorithm'                     => new sfWidgetFormFilterInput(),
      'salt'                          => new sfWidgetFormFilterInput(),
      'password'                      => new sfWidgetFormFilterInput(),
      'created_at'                    => new sfWidgetFormFilterDate(array('from_date' => new sfWidgetFormDate(), 'to_date' => new sfWidgetFormDate(), 'with_empty' => true)),
      'last_login'                    => new sfWidgetFormFilterDate(array('from_date' => new sfWidgetFormDate(), 'to_date' => new sfWidgetFormDate(), 'with_empty' => true)),
      'is_active'                     => new sfWidgetFormChoice(array('choices' => array('' => 'yes or no', 1 => 'yes', 0 => 'no'))),
      'is_super_admin'                => new sfWidgetFormChoice(array('choices' => array('' => 'yes or no', 1 => 'yes', 0 => 'no'))),
      'email'                         => new sfWidgetFormFilterInput(),
      'gender'                        => new sfWidgetFormFilterInput(),
      'account'                       => new sfWidgetFormFilterInput(),
      'rating'                        => new sfWidgetFormFilterInput(),
      'see'                           => new sfWidgetFormFilterInput(),
      'photo'                         => new sfWidgetFormFilterInput(),
      'birthday'                      => new sfWidgetFormFilterDate(array('from_date' => new sfWidgetFormDate(), 'to_date' => new sfWidgetFormDate(), 'with_empty' => true)),
      'phone'                         => new sfWidgetFormFilterInput(),
      'adres'                         => new sfWidgetFormFilterInput(),
      'skype'                         => new sfWidgetFormFilterInput(),
      'icq'                           => new sfWidgetFormFilterInput(),
      'is_top'                        => new sfWidgetFormChoice(array('choices' => array('' => 'yes or no', 1 => 'yes', 0 => 'no'))),
      'is_vip'                        => new sfWidgetFormChoice(array('choices' => array('' => 'yes or no', 1 => 'yes', 0 => 'no'))),
      'is_abon'                       => new sfWidgetFormChoice(array('choices' => array('' => 'yes or no', 1 => 'yes', 0 => 'no'))),
      'is_marital'                    => new sfWidgetFormFilterInput(),
      'language'                      => new sfWidgetFormFilterInput(),
      'have_child'                    => new sfWidgetFormChoice(array('choices' => array('' => 'yes or no', 1 => 'yes', 0 => 'no'))),
      'old_partner'                   => new sfWidgetFormFilterInput(),
      'have_child_partner'            => new sfWidgetFormChoice(array('choices' => array('' => 'yes or no', 1 => 'yes', 0 => 'no'))),
      'country'                       => new sfWidgetFormFilterInput(),
      'have_photos'                   => new sfWidgetFormChoice(array('choices' => array('' => 'yes or no', 1 => 'yes', 0 => 'no'))),
      'have_video'                    => new sfWidgetFormChoice(array('choices' => array('' => 'yes or no', 1 => 'yes', 0 => 'no'))),
      'have_new_message'              => new sfWidgetFormChoice(array('choices' => array('' => 'yes or no', 1 => 'yes', 0 => 'no'))),
      'have_new_interes'              => new sfWidgetFormChoice(array('choices' => array('' => 'yes or no', 1 => 'yes', 0 => 'no'))),
      'have_new_fav'                  => new sfWidgetFormChoice(array('choices' => array('' => 'yes or no', 1 => 'yes', 0 => 'no'))),
      'is_otpusk'                     => new sfWidgetFormChoice(array('choices' => array('' => 'yes or no', 1 => 'yes', 0 => 'no'))),
      'date_expire_abon'              => new sfWidgetFormFilterDate(array('from_date' => new sfWidgetFormDate(), 'to_date' => new sfWidgetFormDate(), 'with_empty' => true)),
      'date_expire_otpusk'            => new sfWidgetFormFilterDate(array('from_date' => new sfWidgetFormDate(), 'to_date' => new sfWidgetFormDate(), 'with_empty' => true)),
      'city'                          => new sfWidgetFormFilterInput(),
      'zip'                           => new sfWidgetFormFilterInput(),
      'time'                          => new sfWidgetFormFilterInput(),
      'block'                         => new sfWidgetFormChoice(array('choices' => array('' => 'yes or no', 1 => 'yes', 0 => 'no'))),
      'sesid'                         => new sfWidgetFormFilterInput(),
      'is_online'                     => new sfWidgetFormChoice(array('choices' => array('' => 'yes or no', 1 => 'yes', 0 => 'no'))),
      'eye_color'                     => new sfWidgetFormFilterInput(),
      'hair_lenght'                   => new sfWidgetFormFilterInput(),
      'hair_color'                    => new sfWidgetFormFilterInput(),
      'hair_type'                     => new sfWidgetFormFilterInput(),
      'education'                     => new sfWidgetFormFilterInput(),
      'religion'                      => new sfWidgetFormFilterInput(),
      'know_lang'                     => new sfWidgetFormFilterInput(),
      'my_read'                       => new sfWidgetFormFilterInput(),
      'my_musik'                      => new sfWidgetFormFilterInput(),
      'my_rest'                       => new sfWidgetFormFilterInput(),
      'my_food'                       => new sfWidgetFormFilterInput(),
      'my_sport'                      => new sfWidgetFormFilterInput(),
      'my_harakter'                   => new sfWidgetFormFilterInput(),
      'partner_age_from'              => new sfWidgetFormFilterInput(),
      'partner_age_to'                => new sfWidgetFormFilterInput(),
      'partner_height_from'           => new sfWidgetFormFilterInput(),
      'partner_height_to'             => new sfWidgetFormFilterInput(),
      'height'                        => new sfWidgetFormFilterInput(),
      'ves'                           => new sfWidgetFormFilterInput(),
      'profession'                    => new sfWidgetFormFilterInput(),
      'is_photo'                      => new sfWidgetFormChoice(array('choices' => array('' => 'yes or no', 1 => 'yes', 0 => 'no'))),
      'is_video'                      => new sfWidgetFormChoice(array('choices' => array('' => 'yes or no', 1 => 'yes', 0 => 'no'))),
      'is_partner'                    => new sfWidgetFormChoice(array('choices' => array('' => 'yes or no', 1 => 'yes', 0 => 'no'))),
      'partner_id'                    => new sfWidgetFormPropelChoice(array('model' => 'sfGuardUser', 'add_empty' => true)),
      'new_message'                   => new sfWidgetFormChoice(array('choices' => array('' => 'yes or no', 1 => 'yes', 0 => 'no'))),
      'new_fav'                       => new sfWidgetFormChoice(array('choices' => array('' => 'yes or no', 1 => 'yes', 0 => 'no'))),
      'new_interest'                  => new sfWidgetFormChoice(array('choices' => array('' => 'yes or no', 1 => 'yes', 0 => 'no'))),
      'new_gift'                      => new sfWidgetFormChoice(array('choices' => array('' => 'yes or no', 1 => 'yes', 0 => 'no'))),
      'about_me'                      => new sfWidgetFormFilterInput(),
      'about_partner'                 => new sfWidgetFormFilterInput(),
      'about_hobby'                   => new sfWidgetFormFilterInput(),
      'age'                           => new sfWidgetFormFilterInput(),
      'introduction_letter'           => new sfWidgetFormFilterInput(),
      'zodiac'                        => new sfWidgetFormFilterInput(),
      'astrology_sign'                => new sfWidgetFormFilterInput(),
      'drinking'                      => new sfWidgetFormChoice(array('choices' => array('' => 'yes or no', 1 => 'yes', 0 => 'no'))),
      'smoking'                       => new sfWidgetFormChoice(array('choices' => array('' => 'yes or no', 1 => 'yes', 0 => 'no'))),
      'wants_children'                => new sfWidgetFormChoice(array('choices' => array('' => 'yes or no', 1 => 'yes', 0 => 'no'))),
      'best_time_of_watch'            => new sfWidgetFormFilterInput(),
      'contact_face'                  => new sfWidgetFormFilterInput(),
      'mobile_phone'                  => new sfWidgetFormFilterInput(),
      'count_user'                    => new sfWidgetFormFilterInput(),
      'bank_information'              => new sfWidgetFormFilterInput(),
      'custom_file1'                  => new sfWidgetFormFilterInput(),
      'custom_file2'                  => new sfWidgetFormFilterInput(),
      'custom_file3'                  => new sfWidgetFormFilterInput(),
      'first_name'                    => new sfWidgetFormFilterInput(),
      'last_name'                     => new sfWidgetFormFilterInput(),
      'full_profile'                  => new sfWidgetFormChoice(array('choices' => array('' => 'yes or no', 1 => 'yes', 0 => 'no'))),
      'have_chanel'                   => new sfWidgetFormChoice(array('choices' => array('' => 'yes or no', 1 => 'yes', 0 => 'no'))),
      'sf_guard_user_group_list'      => new sfWidgetFormPropelChoice(array('model' => 'sfGuardGroup', 'add_empty' => true)),
      'sf_guard_user_permission_list' => new sfWidgetFormPropelChoice(array('model' => 'sfGuardPermission', 'add_empty' => true)),
    ));

    $this->setValidators(array(
      'username'                      => new sfValidatorPass(array('required' => false)),
      'nickname'                      => new sfValidatorPass(array('required' => false)),
      'algorithm'                     => new sfValidatorPass(array('required' => false)),
      'salt'                          => new sfValidatorPass(array('required' => false)),
      'password'                      => new sfValidatorPass(array('required' => false)),
      'created_at'                    => new sfValidatorDateRange(array('required' => false, 'from_date' => new sfValidatorDate(array('required' => false)), 'to_date' => new sfValidatorDate(array('required' => false)))),
      'last_login'                    => new sfValidatorDateRange(array('required' => false, 'from_date' => new sfValidatorDate(array('required' => false)), 'to_date' => new sfValidatorDate(array('required' => false)))),
      'is_active'                     => new sfValidatorChoice(array('required' => false, 'choices' => array('', 1, 0))),
      'is_super_admin'                => new sfValidatorChoice(array('required' => false, 'choices' => array('', 1, 0))),
      'email'                         => new sfValidatorPass(array('required' => false)),
      'gender'                        => new sfValidatorPass(array('required' => false)),
      'account'                       => new sfValidatorSchemaFilter('text', new sfValidatorNumber(array('required' => false))),
      'rating'                        => new sfValidatorSchemaFilter('text', new sfValidatorInteger(array('required' => false))),
      'see'                           => new sfValidatorSchemaFilter('text', new sfValidatorInteger(array('required' => false))),
      'photo'                         => new sfValidatorPass(array('required' => false)),
      'birthday'                      => new sfValidatorDateRange(array('required' => false, 'from_date' => new sfValidatorDate(array('required' => false)), 'to_date' => new sfValidatorDate(array('required' => false)))),
      'phone'                         => new sfValidatorPass(array('required' => false)),
      'adres'                         => new sfValidatorPass(array('required' => false)),
      'skype'                         => new sfValidatorPass(array('required' => false)),
      'icq'                           => new sfValidatorPass(array('required' => false)),
      'is_top'                        => new sfValidatorChoice(array('required' => false, 'choices' => array('', 1, 0))),
      'is_vip'                        => new sfValidatorChoice(array('required' => false, 'choices' => array('', 1, 0))),
      'is_abon'                       => new sfValidatorChoice(array('required' => false, 'choices' => array('', 1, 0))),
      'is_marital'                    => new sfValidatorPass(array('required' => false)),
      'language'                      => new sfValidatorPass(array('required' => false)),
      'have_child'                    => new sfValidatorChoice(array('required' => false, 'choices' => array('', 1, 0))),
      'old_partner'                   => new sfValidatorSchemaFilter('text', new sfValidatorInteger(array('required' => false))),
      'have_child_partner'            => new sfValidatorChoice(array('required' => false, 'choices' => array('', 1, 0))),
      'country'                       => new sfValidatorPass(array('required' => false)),
      'have_photos'                   => new sfValidatorChoice(array('required' => false, 'choices' => array('', 1, 0))),
      'have_video'                    => new sfValidatorChoice(array('required' => false, 'choices' => array('', 1, 0))),
      'have_new_message'              => new sfValidatorChoice(array('required' => false, 'choices' => array('', 1, 0))),
      'have_new_interes'              => new sfValidatorChoice(array('required' => false, 'choices' => array('', 1, 0))),
      'have_new_fav'                  => new sfValidatorChoice(array('required' => false, 'choices' => array('', 1, 0))),
      'is_otpusk'                     => new sfValidatorChoice(array('required' => false, 'choices' => array('', 1, 0))),
      'date_expire_abon'              => new sfValidatorDateRange(array('required' => false, 'from_date' => new sfValidatorDate(array('required' => false)), 'to_date' => new sfValidatorDate(array('required' => false)))),
      'date_expire_otpusk'            => new sfValidatorDateRange(array('required' => false, 'from_date' => new sfValidatorDate(array('required' => false)), 'to_date' => new sfValidatorDate(array('required' => false)))),
      'city'                          => new sfValidatorPass(array('required' => false)),
      'zip'                           => new sfValidatorPass(array('required' => false)),
      'time'                          => new sfValidatorSchemaFilter('text', new sfValidatorInteger(array('required' => false))),
      'block'                         => new sfValidatorChoice(array('required' => false, 'choices' => array('', 1, 0))),
      'sesid'                         => new sfValidatorPass(array('required' => false)),
      'is_online'                     => new sfValidatorChoice(array('required' => false, 'choices' => array('', 1, 0))),
      'eye_color'                     => new sfValidatorPass(array('required' => false)),
      'hair_lenght'                   => new sfValidatorPass(array('required' => false)),
      'hair_color'                    => new sfValidatorPass(array('required' => false)),
      'hair_type'                     => new sfValidatorPass(array('required' => false)),
      'education'                     => new sfValidatorPass(array('required' => false)),
      'religion'                      => new sfValidatorPass(array('required' => false)),
      'know_lang'                     => new sfValidatorPass(array('required' => false)),
      'my_read'                       => new sfValidatorPass(array('required' => false)),
      'my_musik'                      => new sfValidatorPass(array('required' => false)),
      'my_rest'                       => new sfValidatorPass(array('required' => false)),
      'my_food'                       => new sfValidatorPass(array('required' => false)),
      'my_sport'                      => new sfValidatorPass(array('required' => false)),
      'my_harakter'                   => new sfValidatorPass(array('required' => false)),
      'partner_age_from'              => new sfValidatorSchemaFilter('text', new sfValidatorInteger(array('required' => false))),
      'partner_age_to'                => new sfValidatorSchemaFilter('text', new sfValidatorInteger(array('required' => false))),
      'partner_height_from'           => new sfValidatorSchemaFilter('text', new sfValidatorInteger(array('required' => false))),
      'partner_height_to'             => new sfValidatorSchemaFilter('text', new sfValidatorInteger(array('required' => false))),
      'height'                        => new sfValidatorSchemaFilter('text', new sfValidatorInteger(array('required' => false))),
      'ves'                           => new sfValidatorSchemaFilter('text', new sfValidatorInteger(array('required' => false))),
      'profession'                    => new sfValidatorPass(array('required' => false)),
      'is_photo'                      => new sfValidatorChoice(array('required' => false, 'choices' => array('', 1, 0))),
      'is_video'                      => new sfValidatorChoice(array('required' => false, 'choices' => array('', 1, 0))),
      'is_partner'                    => new sfValidatorChoice(array('required' => false, 'choices' => array('', 1, 0))),
      'partner_id'                    => new sfValidatorPropelChoice(array('required' => false, 'model' => 'sfGuardUser', 'column' => 'id')),
      'new_message'                   => new sfValidatorChoice(array('required' => false, 'choices' => array('', 1, 0))),
      'new_fav'                       => new sfValidatorChoice(array('required' => false, 'choices' => array('', 1, 0))),
      'new_interest'                  => new sfValidatorChoice(array('required' => false, 'choices' => array('', 1, 0))),
      'new_gift'                      => new sfValidatorChoice(array('required' => false, 'choices' => array('', 1, 0))),
      'about_me'                      => new sfValidatorPass(array('required' => false)),
      'about_partner'                 => new sfValidatorPass(array('required' => false)),
      'about_hobby'                   => new sfValidatorPass(array('required' => false)),
      'age'                           => new sfValidatorSchemaFilter('text', new sfValidatorInteger(array('required' => false))),
      'introduction_letter'           => new sfValidatorPass(array('required' => false)),
      'zodiac'                        => new sfValidatorPass(array('required' => false)),
      'astrology_sign'                => new sfValidatorPass(array('required' => false)),
      'drinking'                      => new sfValidatorChoice(array('required' => false, 'choices' => array('', 1, 0))),
      'smoking'                       => new sfValidatorChoice(array('required' => false, 'choices' => array('', 1, 0))),
      'wants_children'                => new sfValidatorChoice(array('required' => false, 'choices' => array('', 1, 0))),
      'best_time_of_watch'            => new sfValidatorPass(array('required' => false)),
      'contact_face'                  => new sfValidatorPass(array('required' => false)),
      'mobile_phone'                  => new sfValidatorPass(array('required' => false)),
      'count_user'                    => new sfValidatorSchemaFilter('text', new sfValidatorInteger(array('required' => false))),
      'bank_information'              => new sfValidatorPass(array('required' => false)),
      'custom_file1'                  => new sfValidatorPass(array('required' => false)),
      'custom_file2'                  => new sfValidatorPass(array('required' => false)),
      'custom_file3'                  => new sfValidatorPass(array('required' => false)),
      'first_name'                    => new sfValidatorPass(array('required' => false)),
      'last_name'                     => new sfValidatorPass(array('required' => false)),
      'full_profile'                  => new sfValidatorChoice(array('required' => false, 'choices' => array('', 1, 0))),
      'have_chanel'                   => new sfValidatorChoice(array('required' => false, 'choices' => array('', 1, 0))),
      'sf_guard_user_group_list'      => new sfValidatorPropelChoice(array('model' => 'sfGuardGroup', 'required' => false)),
      'sf_guard_user_permission_list' => new sfValidatorPropelChoice(array('model' => 'sfGuardPermission', 'required' => false)),
    ));

    $this->widgetSchema->setNameFormat('sf_guard_user_filters[%s]');

    $this->errorSchema = new sfValidatorErrorSchema($this->validatorSchema);

    parent::setup();
  }

  public function addsfGuardUserGroupListColumnCriteria(Criteria $criteria, $field, $values)
  {
    if (!is_array($values))
    {
      $values = array($values);
    }

    if (!count($values))
    {
      return;
    }

    $criteria->addJoin(sfGuardUserGroupPeer::USER_ID, sfGuardUserPeer::ID);

    $value = array_pop($values);
    $criterion = $criteria->getNewCriterion(sfGuardUserGroupPeer::GROUP_ID, $value);

    foreach ($values as $value)
    {
      $criterion->addOr($criteria->getNewCriterion(sfGuardUserGroupPeer::GROUP_ID, $value));
    }

    $criteria->add($criterion);
  }

  public function addsfGuardUserPermissionListColumnCriteria(Criteria $criteria, $field, $values)
  {
    if (!is_array($values))
    {
      $values = array($values);
    }

    if (!count($values))
    {
      return;
    }

    $criteria->addJoin(sfGuardUserPermissionPeer::USER_ID, sfGuardUserPeer::ID);

    $value = array_pop($values);
    $criterion = $criteria->getNewCriterion(sfGuardUserPermissionPeer::PERMISSION_ID, $value);

    foreach ($values as $value)
    {
      $criterion->addOr($criteria->getNewCriterion(sfGuardUserPermissionPeer::PERMISSION_ID, $value));
    }

    $criteria->add($criterion);
  }

  public function getModelName()
  {
    return 'sfGuardUser';
  }

  public function getFields()
  {
    return array(
      'id'                            => 'Number',
      'username'                      => 'Text',
      'nickname'                      => 'Text',
      'algorithm'                     => 'Text',
      'salt'                          => 'Text',
      'password'                      => 'Text',
      'created_at'                    => 'Date',
      'last_login'                    => 'Date',
      'is_active'                     => 'Boolean',
      'is_super_admin'                => 'Boolean',
      'email'                         => 'Text',
      'gender'                        => 'Text',
      'account'                       => 'Number',
      'rating'                        => 'Number',
      'see'                           => 'Number',
      'photo'                         => 'Text',
      'birthday'                      => 'Date',
      'phone'                         => 'Text',
      'adres'                         => 'Text',
      'skype'                         => 'Text',
      'icq'                           => 'Text',
      'is_top'                        => 'Boolean',
      'is_vip'                        => 'Boolean',
      'is_abon'                       => 'Boolean',
      'is_marital'                    => 'Text',
      'language'                      => 'Text',
      'have_child'                    => 'Boolean',
      'old_partner'                   => 'Number',
      'have_child_partner'            => 'Boolean',
      'country'                       => 'Text',
      'have_photos'                   => 'Boolean',
      'have_video'                    => 'Boolean',
      'have_new_message'              => 'Boolean',
      'have_new_interes'              => 'Boolean',
      'have_new_fav'                  => 'Boolean',
      'is_otpusk'                     => 'Boolean',
      'date_expire_abon'              => 'Date',
      'date_expire_otpusk'            => 'Date',
      'city'                          => 'Text',
      'zip'                           => 'Text',
      'time'                          => 'Number',
      'block'                         => 'Boolean',
      'sesid'                         => 'Text',
      'is_online'                     => 'Boolean',
      'eye_color'                     => 'Text',
      'hair_lenght'                   => 'Text',
      'hair_color'                    => 'Text',
      'hair_type'                     => 'Text',
      'education'                     => 'Text',
      'religion'                      => 'Text',
      'know_lang'                     => 'Text',
      'my_read'                       => 'Text',
      'my_musik'                      => 'Text',
      'my_rest'                       => 'Text',
      'my_food'                       => 'Text',
      'my_sport'                      => 'Text',
      'my_harakter'                   => 'Text',
      'partner_age_from'              => 'Number',
      'partner_age_to'                => 'Number',
      'partner_height_from'           => 'Number',
      'partner_height_to'             => 'Number',
      'height'                        => 'Number',
      'ves'                           => 'Number',
      'profession'                    => 'Text',
      'is_photo'                      => 'Boolean',
      'is_video'                      => 'Boolean',
      'is_partner'                    => 'Boolean',
      'partner_id'                    => 'ForeignKey',
      'new_message'                   => 'Boolean',
      'new_fav'                       => 'Boolean',
      'new_interest'                  => 'Boolean',
      'new_gift'                      => 'Boolean',
      'about_me'                      => 'Text',
      'about_partner'                 => 'Text',
      'about_hobby'                   => 'Text',
      'age'                           => 'Number',
      'introduction_letter'           => 'Text',
      'zodiac'                        => 'Text',
      'astrology_sign'                => 'Text',
      'drinking'                      => 'Boolean',
      'smoking'                       => 'Boolean',
      'wants_children'                => 'Boolean',
      'best_time_of_watch'            => 'Text',
      'contact_face'                  => 'Text',
      'mobile_phone'                  => 'Text',
      'count_user'                    => 'Number',
      'bank_information'              => 'Text',
      'custom_file1'                  => 'Text',
      'custom_file2'                  => 'Text',
      'custom_file3'                  => 'Text',
      'first_name'                    => 'Text',
      'last_name'                     => 'Text',
      'full_profile'                  => 'Boolean',
      'have_chanel'                   => 'Boolean',
      'sf_guard_user_group_list'      => 'ManyKey',
      'sf_guard_user_permission_list' => 'ManyKey',
    );
  }
}
